#include <Ice\Ice.h>
#include "HelloI.h"

using namespace std;

class HelloServer : public Ice::Application
{
public:
	virtual int run(int, char*[]);
};

int HelloServer::run(int argc, char* argv[]) {
	if (argc>1)
	{
		cerr << appName() << " : too many arguments!" << endl;
		return 0;
	}
	Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapterWithEndpoints("Hello", "tcp");
	Robot::HelloPtr hello = new HelloI();
	adapter->add(hello, communicator()->stringToIdentity("hello"));
	adapter->activate();
	communicator()->waitForShutdown();
	return 0;

}

int main(int argc, char* argv[]) {
	printf("Start RobotServer...\n");
	HelloServer app;
	return app.main(argc, argv, "sNode.cfg");
}

